import {ElMessage} from "element-plus";


// 下载
export function download(res: any, name: any) {
    const fileName = name
    // 这里需要根据不同的文件格式写不同的参数
    const blob = new Blob([res], {
        type: 'application/xlsx'
    })
    const eLink = document.createElement('a')
    eLink.download = fileName
    eLink.style.display = 'none'
    eLink.href = URL.createObjectURL(blob)
    document.body.appendChild(eLink)
    eLink.click()
    URL.revokeObjectURL(eLink.href)
    document.body.removeChild(eLink)
    ElMessage.success(res.msg || '导出成功！');
}
